package com.bite.springmvc.controller;

import org.springframework.web.bind.annotation.*;

@RequestMapping("/hello")
@RestController
public class HelloController {
    //加/更规范
    @RequestMapping("/hello")//建立连接(全部支持)
    public String hello() {
        return "hello spring mvc";
    }

    //仅支持post和get请求
    @RequestMapping(value = "/hello2",method = {RequestMethod.GET,RequestMethod.POST})//数组形式
    public String hello2() {
        return "hello spring mvc";
    }
    //仅支持get请求
    @GetMapping("hello3")
    public String hello3() {
        return "hello spring mvc";
    }
    //仅支持post请求
    @PostMapping("hello4")
    public String hello4() {
        return "hello spring mvc";
    }
}
